﻿<%@ Page Title="" Language="C#" MasterPageFile="~/master_form.master" AutoEventWireup="true" CodeFile="in_ds_thi.aspx.cs" Inherits="App_Form_tuyen_sinh_in_ds_thi" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script type="text/javascript">

        Ext.require([
        'Ext.selection.CellModel',
        'Ext.grid.*',
        'Ext.data.*',
        'Ext.util.*',
        'Ext.state.*',
        'Ext.form.*',
        'Ext.grid.Panel'
        ]);

        Ext.onReady(function () {

            Ext.QuickTips.init();

            var bd = Ext.getBody();

            var gridForm = Ext.create('Ext.form.Panel', {
                id: 'company-form',
                frame: true,
                bodyPadding: 5,
                layout: {
                    type: 'column',
                    columns: 2
                },
                fieldDefaults: {
                    labelAlign: 'left',
                    msgTarget: 'side'
                },

                items: [
                    {
                        margin: '0 0 0 2',
                        padding: '10 5 5 5',
                        xtype: 'fieldset',
                        title: '',
                        defaults: {
                            width: 350,
                            labelWidth: 90
                        },
                        defaultType: 'textfield',
                        items: [
                            {
                            fieldLabel: 'Phòng thi',
                            xtype: 'combo', emptyText: 'Chọn phòng thi', triggerAction: 'all',
                            forceSelection: true, editable: false,
                            id: 'phong_thi', name: 'phong_thi', displayField: 'ten', valueField: 'id', queryMode: 'local'
                        },
                        {
                            xtype: 'fieldcontainer',
                            combineErrors: true,
                            layout: {
                                type: 'hbox',
                                defaultMargins: { top: 0, right: 5, bottom: 0, left: 0 }
                            },
                            items: [
                                {
                                    name: 'In',
                                    xtype: 'button',
                                    margin: '0 0 0 50',
                                    width: 90,
                                    icon: '../../shared/icons/fam/print.png',
                                    text: 'In',
                                    handler: function () {
                                        var b_namhoc = $("#<%=nam.ClientID%>").val(),
                                            b_khoi = $("#<%=khoi.ClientID%>").val(),
                                        b_phong = Ext.getCmp("phong_thi").getValue();
                                        wsinh_vien.Fs_TUYEN_SINH_DS_THI(b_namhoc, b_khoi, b_phong, ds_duthi_P_KQ, P_LOI_CSDL, P_LOI_TGIAN);
                                    }
                                }
                            ]
                        }
                        ]
                    }
                ],
                renderTo: bd
            });
            var b_nam = $("#<%=nam.ClientID%>").val();
            if (b_nam == "" || b_nam == "") return alert("Chưa chọn năm");
            wsinh_vien.Fs_TT_TUYEN_SINH_PHONG(b_nam, P_LOAD_TTCHUNG, P_LOI_CSDL, P_LOI_TGIAN);
        });

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script type="text/javascript">
        function P_LOAD_TTCHUNG(b_kq) {
            if (Fb_LOI_KTRA(b_kq)) {
                form_P_LOI(b_kq);
                return;
            }
            var b_chuoi1 = CH_JSON(b_kq);
            var a_data = Ext.create('Ext.data.Store', {
                fields: ['id', 'ten'],
                data: b_chuoi1
            });

            var cd = Ext.getCmp('phong_thi');
            cd.bindStore(a_data);
        }
        function ds_duthi_P_KQ(b_kq) {
            if (Fb_LOI_KTRA(b_kq)) {
                form_P_LOI(b_kq);
                return;
            }

            var tenf = '<%= this.ResolveUrl("~/Outputs/")%>';
            var a_kq = b_kq.split('/');
            tenf = tenf + a_kq[2];
            window.location.assign(tenf);
        }
    </script>
    <asp:HiddenField runat="server" ID="nam" Value="" />
    <asp:HiddenField runat="server" ID="khoi" Value="" />
</asp:Content>

